#include <cstdio>
#include <cstring>
using namespace std;

#define CHARACTER_SIZE 100

int main()
{
    char buf[CHARACTER_SIZE];
    while (scanf(" %s", buf) != EOF) {
        int len = strlen(buf);
        int side_len = (len + 2) / 3;
        int button_len = len + 2 - 2 * side_len;
        // printf("Side: %d, Button: %d\n", side_len, button_len);
        for (int i = 0; i < side_len; i++) {
            if (i == side_len - 1) {
                for (int j = 0; j < button_len; j++) 
                    printf("%c", buf[side_len - 1 + j]);
                continue;
            }    
            for (int j = 0; j < button_len; j++) {
                if (j == 0) {
                    printf("%c", buf[i]);
                    continue;
                }
                if (j == button_len - 1) {
                    printf("%c\n", buf[len - i - 1]);
                    continue;
                }
                printf(" ");
            }
        }
    }   

    return 0;
}